package com.t235.gc.order.service;

import com.t235.gc.dao.GarbageRecyclingDetailOrderDao;
import com.t235.gc.entity.GarbageRecyclingDetailOrder;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Random;

/**
 * 垃圾回收详情订单表(GarbageRecyclingDetailOrder)表服务实现类
 *
 * @author makejava
 * @since 2021-03-24 08:45:29
 */
@Service
public class GarbageRecyclingDetailOrderService {
    @Resource
    private GarbageRecyclingDetailOrderDao garbageRecyclingDetailOrderDao;


    public int deleteByPrimaryKey(Long detailorderid) {
        return garbageRecyclingDetailOrderDao.deleteByPrimaryKey(detailorderid);
    }

    public int insert(GarbageRecyclingDetailOrder record) {
        return garbageRecyclingDetailOrderDao.insert(record);
    }

    public int insertSelective(GarbageRecyclingDetailOrder record) {
        //生成随机订单详情号
        record.setDetailorderid(System.currentTimeMillis()+ new Random().nextInt(1000));
        return garbageRecyclingDetailOrderDao.insertSelective(record);
    }

    public GarbageRecyclingDetailOrder selectByPrimaryKey(Long detailorderid) {
        return garbageRecyclingDetailOrderDao.selectByPrimaryKey(detailorderid);
    }

    public int updateByPrimaryKeySelective(GarbageRecyclingDetailOrder record) {
        return garbageRecyclingDetailOrderDao.updateByPrimaryKeySelective(record);
    }

    public int updateByPrimaryKey(GarbageRecyclingDetailOrder record) {
        return garbageRecyclingDetailOrderDao.updateByPrimaryKey(record);
    }
}
